<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>原生</title>
    <style>
        .demo{
            width: 200px;
            height: 30px;
            background-color: orange;
            border-radius: 5px;
            padding: 5px;

        }
    </style>
</head>
<body>
    <button id ="btn">点我创建一个输入框</button>

    <script type="text/javascript">
        var btn = document.getElementById(`btn`);
        btn.onclick = function(){
            var input = document.createElement('input');
            input.className = 'demo';
            input.value=99
            document.body.appendChild(input)
            input.focus()
            input.parentElement.style.backgroundColor = 'red'
        }
    </script>

</body>


</html>